package com.github.shiqiyue.learn.guava;

import com.google.common.base.CaseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/***
 * CaseFormat测试
 * @author wenyao.wu
 * @date 2018/7/3
 */
public class CaseFormatTest {

    private static final Logger logger = LoggerFactory.getLogger(CaseFormatTest.class);

    public static void main(String[] args) {
        /***
         * 字符串格式转换
         */
        logger.info(CaseFormat.LOWER_HYPHEN.to(CaseFormat.LOWER_CAMEL, "test-data"));
        logger.info(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "test_data"));
        logger.info(CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, "TEST_DATA"));
        logger.info(CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_HYPHEN, "testData"));
    }

}
